export default class BooleanCommon {
    static isPlayer(玩家: player) {
        return GetPlayerId(玩家) == 0 || GetPlayerId(玩家) == 1 || GetPlayerId(玩家) == 2 || GetPlayerId(玩家) == 3 || GetPlayerId(玩家) == 4 || GetPlayerId(玩家) == 5;
    }
    static isPlayerUnit(单位: unit) {
        return BooleanCommon.isPlayer(GetOwningPlayer(单位));
    }
    private static treeIds = [
        FourCC('ZTtc'),
        FourCC('BTtc'),
        FourCC('NTtc'),
        FourCC('CTtc'),
        FourCC('ITtc'),
        FourCC('ATtc'),
        FourCC('ZTtw'),
        FourCC('LTlt'),
        FourCC('ETtw'),
        FourCC('FTtw'),
        FourCC('NTtw'),
        FourCC('WTst'),
        FourCC('BTtw'),
        FourCC('KTtw'),
        FourCC('CTtr'),
        FourCC('WTtw'),
        FourCC('DTsh'),
        FourCC('GTsh'),
        FourCC('JTtw'),
        FourCC('VTlt'),
        FourCC('YTct'),
        FourCC('YTft'),
        FourCC('JTct'),
        FourCC('YTst'),
        FourCC('YTwt'),
        FourCC('ITtw'),
        FourCC('OTtw'),
        FourCC('ATtr'),
    ];
    static isTree(d: destructable) {
        for (let i = 0; i < BooleanCommon.treeIds.length; i++) {
            if (GetDestructableTypeId(d) == BooleanCommon.treeIds[i]) {
                return true;
            }
        }
        return false;
    }
}
